/**
 * 
 */
package com.handinfo.uimenu.window;

import java.io.DataInputStream;
import java.io.IOException;

import javax.microedition.lcdui.Graphics;

import com.handinfo.engine.AbstractGameScreen;
import com.handinfo.engine.GameManager;
import com.handinfo.game.ActorItem;
import com.handinfo.uimenu.UIAbstractWindow;
import com.handinfo.uimenu.UIManager;
import com.handinfo.uimenu.UITools;
import com.handinfo.uimenu.UIWindowFactory;
import com.handinfo.util.Tools;
import com.test.touch.GameTouchManager;

/**
 * @author venizeng
 * 
 */
public class UIActorItemDetail extends UIAbstractWindow
{
	/**
	 * 此类包含道具详情的两种状态
	 */
	private final int STATE_DETAIL = 1;// 详情状态
	private final int STATE_COMPARE = 2;// 对比状态
	/**
	 * 索引标识
	 */
	private final int NUMBER_USELESS = -1;// 无用
	private final int INDEX_LEVEL = 0;// 品阶
	private final int INDEX_TYPE_SUB = 1;// 道具子类
	private final int INDEX_PRICE = 2;// 出售价格
	private final int INDEX_NAIJIU = 3;// 耐久
	private final int INDEX_TYPE_OPER = 4;// 操作类型
	private final int INDEX_COMMIT_CAREER = 5;// 职业限制
	private final int INDEX_COMMIT_LEVEL = 6;// 等级限制
	private final int INDEX_COMMIT_EQUIP = 7;// 装备限制
	private final int INDEX_CD = 8;// 使用CD
	private final int INDEX_DEADLINE = 9;// 存在期限
	private final int INDEX_ATTACT_PHY = 10;
	private final int INDEX_ATTACT_MAGIC_MIN = 11;// 最小法术攻击
	private final int INDEX_ATTACT_MAGIC_MAX = 12;// 最大法术攻击
	private final int INDEX_DEFENCE_PHY = 13;// 物理防御
	private final int INDEX_DEFENCE_MAGIC = 14;// 魔法攻击
	private final int INDEX_HIT_BASIC = 15;
	private final int INDEX_MAXHP = 16;
	private final int INDEX_MAXMP = 17;
	private final int INDEX_SPEED_HP = 18;
	private final int INDEX_SPEED_MP = 19;
	private final int INDEX_FORCE = 20;
	private final int INDEX_INTELLIGENCE = 21;
	private final int INDEX_JIQIAO = 22;
	private final int INDEX_MINJIE = 23;
	private final int INDEX_NAILI = 24;
	private final int INDEX_LUCK = 25;
	private final int INDEX_ATTACT_MAGIC_ADD = 26;
	private final int INDEX_ATTACT_YINXING_ADD = 27;// 阴性强化
	private final int INDEX_ATTACT_BINGXING_ADD = 28;// 阴性强化
	private final int INDEX_ATTACT_HUANGXING_ADD = 29;// 阴性强化
	private final int INDEX_ATTACT_SHENXING_ADD = 30;// 圣性强化
	private final int INDEX_ATTACT_BAOJI_PHY = 31;// 物理暴击
	private final int INDEX_ATTACT_BAOJI_MAGIC = 32;// 法术暴击
	private final int INDEX_ATTACT_BAOJI_PHY_ADD = 33;// 物暴伤害加
	private final int INDEX_ATTACT_BAOJI_MAGIC_ADD = 34;// 法暴伤害加
	private final int INDEX_ATTACT_CHUANTOU_PHY = 35;// 物理穿透
	private final int INDEX_ATTACT_CHUANTOU_MAGIC = 36;// 法术穿透
	private final int INDEX_ATTACT_FINAL_PHY = 37;// 物理最终命中
	private final int INDEX_ATTACT_FINAL_MAGIC = 38;// 法术最终命中
	private final int INDEX_ATTACT_HUIBILV = 39;// 回避率
	private final int INDEX_ATTACT_JIANMIAN_PHY = 40;// 物伤减免
	private final int INDEX_ATTACT_JIANMIAN_MAGIC = 41;// 法伤减免
	private final int INDEX_ATTACT_JIANMIAN_BAOJI = 42;// 法伤减免
	private final int INDEX_DEFENCE_ADD_YINXING = 43;
	private final int INDEX_DEFENCE_ADD_BINGXING = 44;
	private final int INDEX_DEFENCE_ADD_HUANGXING = 45;
	private final int INDEX_DEFENCE_ADD_SHENXING = 46;
	private final int INDEX_HUIFU_SWARD_ADD = 47;
	private final int INDEX_XIAOGUO_FULING = 48;
	private final int INDEX_HOLE_RED = 49;
	private final int INDEX_HOLE_YELLOW = 50;
	private final int INDEX_HOLE_BLUE = 51;
	private final int INDEX_HOLE_GREEN = 52;
	private final int INDEX_HUIFU_LIFE = 53;
	private final int INDEX_HUIFU_SWARD = 54;
	private final int INDEX_HUIFU_JINGQI = 55;
	private final int INDEX_HUIFU_DOUQI = 56;
	private final int INDEX_DESCRBE = 57;
	private final int INDEX_TAOZHUANG = 58;
	private final int INDEX_DESCRIBE_DEF = 59;
	private final int INDEX_JEWEL = 60;
	private final int INDEX_TAOZHUANG_INFO = 61;
	private final int INDEX_NAME = 62;
	private final int INDEX_BANGDING = 64;
	private final int INDEX_TIME = 65;
	private final int INDEX_MINGZHONG_2 = 66;
	private final int INDEX_MINGZHONG_LAST = 67;
	private final int INDEX_LEVEL_WEAPON_WULI = 68;
	private final int INDEX_LEVEL_WEAPON_FASHU = 69;
	private final int INDEX_BANGDING_CISHU = 70;//剩余解绑次数
	/**
	 * 数据属性名称
	 */
	private final String STR_NAME = "名称:";
	private final String STR_LEVEL = "品阶:";
	private final String STR_BANGDING = "绑定类型";
	private final String STR_TYPE_SUB = "道具子类:";
	private final String STR_PRICE = "出售价格:";
	private final String STR_NAIJIU = "耐久度:";
	private final String STR_TYPE_OPER = "操作类型:";
	private final String STR_COMMIT_CAREER = "职业限制:";
	private final String STR_COMMIT_LEVEL = "等级限制:";
	private final String STR_COMMIT_EQUIP = "装备限制:";
	private final String STR_CD = "冷却时间:";
	private final String STR_DEADLINE = "存在期限:";
	private final String STR_ATTACT_PHY = "物理攻击:";
	private final String STR_ATTACT_MAGIC_MIN = "最小法术攻击:";// 最小法术攻击
	private final String STR_ATTACT_MAGIC_MAX = "最大法术攻击:";// 最大法术攻击
	private final String STR_DEFENCE_PHY = "物理防御:";// 物理防御
	private final String STR_DEFENCE_MAGIC = "法术防御:";// 魔法攻击
	private final String STR_HIT_BASIC = "基础命中:";
	private final String STR_MAXHP = "最大HP+:";
	private final String STR_MAXMP = "最大MP+:";
	private final String STR_SPEED_HP = "HP恢复速度 :";
	private final String STR_SPEED_MP = "MP恢复速度:";
	private final String STR_FORCE = "力量:";
	private final String STR_INTELLIGENCE = "智力:";
	private final String STR_JIQIAO = "技巧:";
	private final String STR_MINJIE = "敏捷:";
	private final String STR_NAILI = "耐力:";
	private final String STR_LUCK = "运气:";
	private final String STR_ATTACT_MAGIC_ADD = "法术伤害加成:";
	private final String STR_ATTACT_YINXING_ADD = "阴性伤害加成:";// 阴性强化
	private final String STR_ATTACT_BINGXING_ADD = "冰性伤害加成:";// 阴性强化
	private final String STR_ATTACT_HUANGXING_ADD = "煌性伤害加成:";// 阴性强化
	private final String STR_ATTACT_SHENXING_ADD = "圣性伤害加成:";// 圣性强化
	private final String STR_ATTACT_BAOJI_PHY = "物理暴击:";// 物理暴击
	private final String STR_ATTACT_BAOJI_MAGIC = "法术暴击:";// 法术暴击
	private final String STR_ATTACT_BAOJI_PHY_ADD = "物理暴击伤害加成:";// 物暴伤害加
	private final String STR_ATTACT_BAOJI_MAGIC_ADD = "法术暴击伤害加成:";// 法暴伤害加
	private final String STR_ATTACT_CHUANTOU_PHY = "物理穿透:";// 物理穿透
	private final String STR_ATTACT_CHUANTOU_MAGIC = "法术穿透:";// 法术穿透
	private final String STR_ATTACT_FINAL_PHY = "物理命中:";// 物理最终命中
	private final String STR_ATTACT_FINAL_MAGIC = "法术命中:";// 法术最终命中
	private final String STR_ATTACT_HUIBILV = "回避率:";// 回避率
	private final String STR_ATTACT_JIANMIAN_PHY = "物理伤害减免:";// 物伤减免
	private final String STR_ATTACT_JIANMIAN_MAGIC = "法术伤害减免:";// 法伤减免
	private final String STR_ATTACT_JIANMIAN_BAOJI = "暴击伤害减免:";// 法伤减免
	private final String STR_DEFENCE_ADD_YINXING = "阴性抗性加成:";
	private final String STR_DEFENCE_ADD_BINGXING = "冰性抗性加成:";
	private final String STR_DEFENCE_ADD_HUANGXING = "煌性抗性加成:";
	private final String STR_DEFENCE_ADD_SHENXING = "圣性抗性加成:";
	private final String STR_HUIFU_SWARD_ADD = "剑气恢复+:";
	private final String STR_XIAOGUO_FULING = "附灵效果:";
	private final String STR_HOLE_RED = "红色凹槽:";
	private final String STR_HOLE_YELLOW = "黄色凹槽:";
	private final String STR_HOLE_BLUE = "蓝色凹槽:";
	private final String STR_HOLE_GREEN = "绿色凹槽:";
	private final String STR_HUIFU_LIFE = "回复生命:";
	private final String STR_HUIFU_SWARD = "回复剑气:";
	private final String STR_HUIFU_JINGQI = "回复精气:";
	private final String STR_HUIFU_DOUQI = "回复斗气:";
	private final String STR_DESCRBE = "";// 描述:
	private final String STR_TAOZHUANG = "套装:";
	private final String STR_DESCRIBE_DEF = "";// 自定义描述:
	private final String STR_JEWEL = "宝石镶嵌状况显示: ";
	private final String STR_TAOZHUANG_INFO = "套装信息: ";
	private final String STR_TIME = "剩余时间:";
	private final String STR_MINGZHONG_2 = "第二命中: ";
	private final String STR_MINGZHONG_LAST = "最终命中: ";
	private final String STR_LEVEL_WEAPON_WULI = "物理强化等级: ";
	private final String STR_LEVEL_WEAPON_FASHU = "法术强化等级: ";
	private final String STR_BANGDINGCISHU = "可解绑次数: ";
	/**
	 * 所有数据对象都存成数组对象， 详情状态数组长度为1 ;对比状态长度为2
	 */
	private int[] m_levels;// 品级
	private String[] m_names;// 名称
	private String[] m_bangding;
	private byte[] m_color_xiyoudu;// 稀有度
	private String[] m_type_subs;// 道具类型名称
	private long[] m_prices;// 出售价格
	private short[] m_naijius;// 耐久
	private short[] m_naijius_max;// 耐久
	private String[][] m_type_opers;// 操作类型
	private int[] m_type_operB;// 操作类型
	private String[] m_limit_careers;// 职业限制
	private int[] m_limit_levels;// 职业限制
	private String[] m_limit_equips;// 职业限制
	private int[] m_time_cds;
	private long[] m_time_deadLines;
	private int[] m_attact_phys;// A（0,1）+B（2,3）
	private int[] m_attact_magic_mins;// A（0,1）+B（2,3）
	private int[] m_attact_magic_maxs;// A（0,1）+B（2,3）
	private int[] m_defence_phys;// A（0,1）+B（2,3）
	private int[] m_defence_magics;// A（0,1）+B（2,3）
	private int[] m_hit_basics;// A（0,1）+B（2,3）
	private int[] m_maxhps;// A（0,1）+B（2,3）
	private int[] m_maxmps;// A（0,1）+B（2,3）
	private int[] m_speed_hps;// A（0,1）+B（2,3）
	private int[] m_speed_mps;// A（0,1）+B（2,3）
	private int[] m_foces;// A（0,1）+B（2,3）
	private int[] m_intelligences;// A（0,1）+B（2,3）
	private int[] m_jiqiaos;// A（0,1）+B（2,3）
	private int[] m_minjies;// A（0,1）+B（2,3）
	private int[] m_nailis;// A（0,1）+B（2,3）
	private int[] m_lucks;// A（0,1）+B（2,3）
	//
	private int[] m_attact_magic_adds;// A（0,1）+B（2,3）
	private int[] m_attact_yinxing_adds;// A（0,1）+B（2,3）
	private int[] m_attact_bingxing_adds;// A（0,1）+B（2,3）
	private int[] m_attact_huangxing_adds;// A（0,1）+B（2,3）
	private int[] m_attact_shenxing_adds;// A（0,1）+B（2,3）
	private int[] m_attact_baoji_phy;// A（0,1）+B（2,3）
	private int[] m_attact_baoji_magic;// A（0,1）+B（2,3）
	private int[] m_attact_baoji_phy_adds;// A（0,1）+B（2,3）
	private int[] m_attact_baoji_magic_adds;// A（0,1）+B（2,3）
	private int[] m_attact_chuantou_phys;// A（0,1）+B（2,3）
	private int[] m_attact_chuantou_magics;// A（0,1）+B（2,3）
	private int[] m_attact_final_phys;// A（0,1）+B（2,3）
	private int[] m_attact_final_magics;// A（0,1）+B（2,3）
	private int[] m_attact_huibilvs;// A（0,1）+B（2,3）
	private int[] m_attact_jianmian_phys;// A（0,1）+B（2,3）
	private int[] m_attact_jianmian_magics;// A（0,1）+B（2,3）
	private int[] m_attact_jianmian_baojis;// A（0,1）+B（2,3）
	private int[] m_dence_yinxing_adds;// A（0,1）+B（2,3）
	private int[] m_dence_bingxing_adds;// A（0,1）+B（2,3）
	private int[] m_dence_huangxing_adds;// A（0,1）+B（2,3）
	private int[] m_dence_shengxing_adds;// A（0,1）+B（2,3）
	private int[] m_huifu_sward_adds;// A（0,1）+B（2,3）
	private int[] m_result_fulings;// A（0,1）+B（2,3）
	private int[] m_hole_reds;// A（0,1）+B（2,3）
	private int[] m_hole_yellows;// A（0,1）+B（2,3）
	private int[] m_hole_blues;// A（0,1）+B（2,3）
	private int[] m_hole_greens;// A（0,1）+B（2,3）
	private int[] m_huifu_lifes;// A（0,1）+B（2,3）
	private int[] m_huifu_swards;// A（0,1）+B（2,3）
	private int[] m_huifu_jingqis;// A（0,1）+B（2,3）
	private int[] m_huifu_douqis;// A（0,1）+B（2,3）
	//
	private String[][] m_describes;
	private int[] m_taozhuangs;
	private String[][] m_describe_defs;
	//
	private String[] m_taozhuang_name;// 套装的名字
	private String[][] m_taozhuang_part_name;// 套装部件的名字
	private boolean[][] m_taozhuang_part_isOn;// 套装部件是否穿上
	private String[][][] m_taozhuang_part_att;// 套装部件描述
	private byte[][] m_taozhuang_part_numNeed;
	private boolean[][] m_taozhuang_part_isWorking;

	private int[] m_level_weapon_wulin;
	private int[] m_level_weapon_fashu;

	private String[] m_times;
	private int[] m_mingzhong_2;
	private int[] m_mingzhong_last;
	
	private int[] m_bangdingcishu;// 
	//
	private final int COLOR_ATT = UIManager.getPaletteColor(UIManager.COLOR_WORD_NOS);
	private final int COLOR_A = Tools.GREEN;
	private final int COLOR_PLUS = Tools.RED;
	private final int COLOR_B = Tools.YELLOW;
	private final int COLOR_DESCRIBE = Tools.WHITE;
	private final int COLOR_TAOZHUANG_NAME = Tools.GREEN;// 套装名称
	private final int COLOR_TAOZHUANG_SHARE_ON = Tools.GREEN;// 部件装备在身上
	private final int COLOR_TAOZHUANG_SHARE_OFF = Tools.GRAY;// 部件未装备在身上
	private final int COLOR_TAOZHUANG_SHARE_WROKING = Tools.GREEN;// 部件装备在身上
	private final int COLOR_TAOZHUANG_SHARE_UNWROKING = Tools.GRAY;// 部件未装备在身上
	//
	private String m_title;// 标题名称
	private short[][] m_keys;// 当前的数据索引集合
	//
	private final String PLUS = "+";
	private final int IW_STR = 5;// 属性到值之间的间隔
	private final int IW_PLUS = 10;// +的宽度
	//
	private final int W_BG = UITools.W_BG;
	private final int H_BG = UITools.H_BG;
	private final int H_PRE = AbstractGameScreen.FONT_H;// 每行的高度
	private final int H_MID = UITools.IH_RECTS;// 中间行高度,如存在两个道具数据需要中间隔开一定距离
	private final int W_BORDER_RECT = UITools.INITX_CONTENT;// 初始化位置
	private final int W_RECT_CONTENT = UITools.IW_RECT_CONTENT;// 内容框到框体的x轴间距
	private final int W_RECT = UITools.W_RECT_DRAG;
	private final int W_CONTENT = W_RECT - (W_RECT_CONTENT << 1);// 内容层宽度
	// 根据状态定
	private int H_RECT;// 框的高度，对比的时候是一个框的高度
	private int NUM_MAX_ROWS;// 显示的行数
	private int H_LOGIC;// 数据高度
	//
	private int[] Y_RECT;// 当前两个框所在位置
	private int[] SUMH;// 所有数据的高度
	private int[] m_relY;// 相对位置
	// private int[] Y_REL_RECT_CONTENT;// 内容相对框的位置
	private int[] m_plan;// 下拉条进度比

	public UIActorItemDetail(int id)
	{
		super(id);
		setBounds(UITools.X_BG, UITools.Y_BG, W_BG, H_BG);
	}

	/**
	 * 创建的时候会调用
	 */
	private void init()
	{
		if (m_keys == null) {
			Tools.debugPrintln("UIActorItemDetail:未传入数据");
			return;
		}
		m_state = m_keys.length == 1 ? STATE_DETAIL : STATE_COMPARE;// 设置当前状态
		m_title = m_state == STATE_DETAIL ? "道具详情" : "道具对比";// 设置标题

		// 变量
		if (m_state == STATE_COMPARE) {
			Y_RECT = new int[2];
			SUMH = new int[2];
			m_relY = new int[2];
			m_plan = new int[2];
			H_RECT = ((UITools.H_RECT - H_MID) >> 1);
		}
		else {
			Y_RECT = new int[1];
			SUMH = new int[1];
			m_relY = new int[1];
			m_plan = new int[1];
			H_RECT = UITools.H_RECT;
		}
		NUM_MAX_ROWS = (H_RECT - (W_RECT_CONTENT << 1)) / H_PRE;
		H_LOGIC = NUM_MAX_ROWS * H_PRE;

		Y_RECT[0] = m_y + UITools.INITY_CONTENT;// 初始化位置
		if (m_state == STATE_COMPARE) {
			Y_RECT[1] = Y_RECT[0] + H_RECT + H_MID;
		}
		// 获得两框的高度
		for (int i = 0, length = m_keys.length; i < length; i++) {
			short[] keys = m_keys[i];
			for (int j = 0; j < m_keys[i].length; j++) {
				SUMH[i] += getItemHeight(i, keys[j]);
			}
		}
	}

	/**
	 * 测试数据 以后移除
	 */
	public static final void test()
	{
		UIActorItemDetail detail = (UIActorItemDetail) UIWindowFactory
				.createWindow(UIWindowFactory.WINDOW_ACTOR_DETAIL);
		detail.m_keys = new short[1][62];
		for (int i = 0; i < detail.m_keys.length; i++) {
			for (short j = 0; j < detail.m_keys[i].length; j++) {
				detail.m_keys[i][j] = j;
			}
		}
		detail.m_levels = new int[] { 1, 2 };
		detail.m_type_subs = new String[] { "宝石", "haodongxi" };
		detail.m_prices = new long[] { 200, 390 };
		detail.m_naijius = new short[] { 200, 390 };
		detail.m_type_opers = new String[][] { { "不可丢弃", "不可分解" }, { "不可丢弃", "不可分解" } };
		detail.m_limit_careers = new String[] { "大法师", "剑客" };
		detail.m_limit_levels = new int[] { 1, 2 };//
		detail.m_limit_equips = new String[] { "装备A", "装备B" };
		detail.m_time_cds = new int[] { 893, 7832 };
		detail.m_time_deadLines = new long[] { 832, 3232 };
		detail.m_attact_phys = new int[] { 323, 323, 5, 54 };
		detail.m_attact_magic_mins = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_magic_maxs = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_defence_phys = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_defence_magics = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_hit_basics = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_maxhps = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_maxmps = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_speed_hps = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_speed_mps = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_foces = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_intelligences = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_jiqiaos = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_minjies = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_nailis = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_lucks = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_magic_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_yinxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_bingxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_huangxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_shenxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_baoji_phy = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_baoji_magic = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_baoji_phy_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_baoji_magic_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_chuantou_phys = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_chuantou_magics = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_final_phys = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_final_magics = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_huibilvs = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_jianmian_phys = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_jianmian_magics = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_attact_jianmian_baojis = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_dence_yinxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_dence_bingxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_dence_huangxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_dence_shengxing_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_huifu_sward_adds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_result_fulings = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_hole_reds = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_hole_yellows = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_hole_blues = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_hole_greens = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_huifu_lifes = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_huifu_swards = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_huifu_jingqis = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_huifu_douqis = new int[] { 323, 323, 5, 54 };// A（0,1）+B（2,3）
		detail.m_describes = new String[][] { { "描述Ajdkjsad描述S", "描述Adsakjdahdkjash描述E" },
				{ "描述Bjdkjsad描述S", "描述Bjdkjsad描述E" } };
		detail.m_taozhuang_name = new String[] { "套装1", "套装2" };// 套装的名字
		detail.m_taozhuangs = new int[] { 323, 323 };// A（0,1）+B（2,3）;
		detail.m_describe_defs = new String[][] { { "描述DEF_Ajdkjsad描述S", "描述DEF_Ajdkjsad描述E" },
				{ "描述DEF_Bjdkjsad描述S", "描述DEF_Bjdkjsad描述E" } };
		detail.m_taozhuang_name = new String[] { "套装A", "套装B" };
		detail.m_taozhuang_part_name = new String[][] { { "套装A1", "套装B1" }, { "套装A2", "套装B2" } };
		detail.m_taozhuang_part_isOn = new boolean[][] { { true, true }, { false, false } };
		detail.m_taozhuang_part_isWorking = new boolean[][] { { true, true }, { false, false } };
		detail.m_taozhuang_part_att = new String[][][] { { { "套装A1ATT", "套装A1ATT" }, { "套装B1ATT", "套装B1ATT" } },
				{ { "套装A2ATT", "套装A2ATT" }, { "套装B2ATT", "套装B2ATT" } } };
		detail.m_taozhuang_part_numNeed = new byte[][] { { 1, 2 }, { 3, 4 } };
		detail.init();
		UIManager.getInstance().addWindow(detail);
	}

	/**
	 * relY 的最小值，即能上移到的最高点位置 2012-2-23 上午08:58:53 venizeng
	 * 
	 * @param index
	 * @return
	 */
	private int countRelTopY(int index)
	{
		int expectTopY = H_LOGIC - SUMH[index];
		expectTopY = expectTopY >= 0 ? 0 : expectTopY;
		return expectTopY;
	}

	/**
	 * 获得当前下拉条的百分比 2012-2-23 上午09:02:33 venizeng
	 * 
	 * @param index
	 * @param exceptY
	 * @return
	 */
	private int countPlan(int index, int exceptY)
	{
		if (m_relY[index] == 0) {
			return 0;
		}
		else if (m_relY[index] == exceptY) {
			return 100;
		}
		else {
			return 100 * (m_relY[index]) / exceptY;
		}
	}

	/**
	 * 修改相对位置 并计算当前的下拉条百分比， 2012-2-23 上午08:46:18 venizeng
	 * 
	 * @param relY
	 * @param exceptY
	 * @param index
	 */
	private void changeRelY(int index, int relY, int exceptY)
	{
		m_relY[index] = relY;
		m_plan[index] = countPlan(index, exceptY);
	}

	private void keyUp(int index)
	{
		if (m_relY[index] < 0) {
			changeRelY(index, m_relY[index] + H_PRE, countRelTopY(index));
		}
	}

	private void keyDown(int index)
	{
		int exceptY = countRelTopY(index);
		if (m_relY[index] > exceptY) {
			changeRelY(index, m_relY[index] - H_PRE, exceptY);
		}
	}

	private void keyUp()
	{
		switch (m_state) {
			case STATE_DETAIL:
				keyUp(0);
				break;
			case STATE_COMPARE:
				if (SUMH[0] > SUMH[1]) {
					if (m_relY[0] == m_relY[1]) {// 只有在两者完全相同的时候，短的才具备移动的条件
						keyUp(1);
					}
					keyUp(0);
				}
				else {
					if (m_relY[0] == m_relY[1]) {// 只有在两者完全相同的时候，短的才具备移动的条件
						keyUp(0);
					}
					keyUp(1);
				}
				break;
		}
	}

	private void keyDown()
	{
		switch (m_state) {
			case STATE_DETAIL:
				keyDown(0);
				break;
			case STATE_COMPARE:
				if (SUMH[0] > SUMH[1]) {
					if (m_relY[0] == m_relY[1]) {// 只有在两者完全相同的时候，短的才具备移动的条件
						keyDown(1);
					}
					keyDown(0);
				}
				else {
					if (m_relY[0] == m_relY[1]) {// 只有在两者完全相同的时候，短的才具备移动的条件
						keyDown(0);
					}
					keyDown(1);
				}
				break;
		}
	}

	protected void keyLogic()
	{
		if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_UP)) {
			keyUp();
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_DOWN)) {
			keyDown();
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_RIGHT_SOFT)) {
			close();
		}
	}

	protected void paintContent(Graphics g)
	{
		UITools.paintBackGround(g, m_x, m_y, m_w, m_h, m_title);
		int tempX = m_x + W_BORDER_RECT;
		switch (m_state) {
			case STATE_DETAIL:
				drawContent(g, tempX, Y_RECT[0], W_RECT, H_RECT, 0);
				break;
			case STATE_COMPARE:
				drawContent(g, tempX, Y_RECT[0], W_RECT, H_RECT, 0);
				drawContent(g, tempX, Y_RECT[1], W_RECT, H_RECT, 1);
				break;
		}
	}

	/**
	 * 绘制内容
	 * 
	 * @param g
	 * @param x
	 * @param y
	 * @param w
	 * @param h
	 * @param index
	 */
	private void drawContent(Graphics g, int x, int y, int w, int h, int index)
	{
		int clipX = g.getClipX();
		int clipY = g.getClipY();
		int clipW = g.getClipWidth();
		int clipH = g.getClipHeight();
		UITools.paintContentRect(g, x, y, w, h);
		int tempX = x + W_RECT_CONTENT;
		int tempY = y + W_RECT_CONTENT;
		g.setClip(tempX, tempY, w - (W_RECT_CONTENT << 1), h - (W_RECT_CONTENT << 1));
		paintItems(g, tempX, tempY, index);
		g.setClip(clipX, clipY, clipW, clipH);
		UITools.paintScrollBar(g, m_x + UITools.X_DRAG, y, h, m_plan[index]);
	}

	private void paintItems(Graphics g, int x, int y, int index)
	{
		short[] infos = m_keys[index];
		if (infos == null) {
			return;
		}
		int tempY = y + m_relY[index];
		int endY = y + H_LOGIC;
		for (int i = 0, length = infos.length; i < length; i++) {
			if (infos[i] == NUMBER_USELESS) {
				continue;
			}
			if (tempY < y) {// 显示范围在屏幕之上
				tempY += H_PRE;
			}
			else if (tempY >= endY) {// 显示范围在屏幕之下
				return;
			}
			else {
				try {
					paintItem(g, x, tempY, index, infos[i]);
				}
				catch (Exception e) {
				}
				// g.setColor(0xffffff) ;
				// g.drawString("H" + getItemHeight(index, infos[i])+"K" +
				// infos[i], x + 100, tempY,0) ;
				tempY += getItemHeight(index, infos[i]);
			}
		}
	}

	private int getStrsHeight(String[][] items, int index)
	{
		if (items == null) {
			return 0;
		}
		return getStrsHeight(items[index]);
	}

	private int getStrsHeight(String[] items)
	{
		if (items == null) {
			return 0;
		}
		int H = 0;
		for (int i = 0, length = items.length; i < length; i++) {
			if (items[i] == null) {
				continue;
			}
			H += H_PRE;
		}
		return H;
	}

	private int getItemHeight(int index, short key)
	{
		switch (key) {
			case NUMBER_USELESS:
				return 0;
			case INDEX_TYPE_OPER:
				return getStrsHeight(m_type_opers, index);
			case INDEX_DESCRBE:
				return getStrsHeight(m_describes, index);
			case INDEX_TAOZHUANG_INFO: {
				int H = 0;// 套装名字
				if (m_taozhuang_name == null) {
					return H;
				}
				H += H_PRE;
				if (m_taozhuang_part_name == null) {
					return H;
				}
				if (m_taozhuang_part_name[index] == null) {
					return H;
				}
				H += m_taozhuang_part_name[index].length * H_PRE;// 部件名称
				if (m_taozhuang_part_att != null) {
					H += m_taozhuang_part_numNeed[index].length * H_PRE;// 需要多少件
					for (int i = 0; i < m_taozhuang_part_att[index].length; i++) {// 描述
						H += getStrsHeight(m_taozhuang_part_att[index][i]);
					}
				}
				return H;
			}
			case INDEX_PRICE:
				if (m_prices[index] == 0) {
					return 0;
				}
				return H_PRE ;
//				if (Tools.getBitNum(m_type_operB[index], 1)) {//是否可出售
//					return H_PRE;
//				}
//				else {
//					return 0;
//				}
			case INDEX_DESCRIBE_DEF:
				return getStrsHeight(m_describes, index);
			case INDEX_BANGDING_CISHU:
				if (m_bangdingcishu[index] <= 0) {
					return 0 ;
				}
				return H_PRE ;
			case INDEX_LEVEL_WEAPON_WULI:
				if (m_level_weapon_wulin[index] <= 0) {
					return 0 ;
				}
				return H_PRE ;
			case INDEX_LEVEL_WEAPON_FASHU:
				if (m_level_weapon_fashu[index] <= 0) {
					return 0 ;
				}
				return H_PRE ;
			case INDEX_TAOZHUANG:
				return H_PRE;
			case INDEX_NAME:
			case INDEX_JEWEL:
			case INDEX_LEVEL:// 品级
			case INDEX_NAIJIU:
			case INDEX_TYPE_SUB:
			case INDEX_COMMIT_CAREER:
			case INDEX_COMMIT_LEVEL:
			case INDEX_COMMIT_EQUIP:
			case INDEX_CD:
			case INDEX_DEADLINE:
			case INDEX_ATTACT_PHY:
			case INDEX_ATTACT_MAGIC_MIN:
			case INDEX_ATTACT_MAGIC_MAX:
			case INDEX_DEFENCE_PHY:
			case INDEX_DEFENCE_MAGIC:
			case INDEX_HIT_BASIC:
			case INDEX_MAXHP:
			case INDEX_MAXMP:
			case INDEX_SPEED_HP:
			case INDEX_SPEED_MP:
			case INDEX_FORCE:
			case INDEX_INTELLIGENCE:
			case INDEX_JIQIAO:
			case INDEX_MINJIE:
			case INDEX_NAILI:
			case INDEX_LUCK:
			case INDEX_ATTACT_MAGIC_ADD:
			case INDEX_ATTACT_YINXING_ADD:
			case INDEX_ATTACT_BINGXING_ADD:
			case INDEX_ATTACT_HUANGXING_ADD:
			case INDEX_ATTACT_SHENXING_ADD:
			case INDEX_ATTACT_BAOJI_PHY:
			case INDEX_ATTACT_BAOJI_MAGIC:
			case INDEX_ATTACT_BAOJI_PHY_ADD:
			case INDEX_ATTACT_BAOJI_MAGIC_ADD:
			case INDEX_ATTACT_CHUANTOU_PHY:
			case INDEX_ATTACT_CHUANTOU_MAGIC:
			case INDEX_ATTACT_FINAL_PHY:
			case INDEX_ATTACT_FINAL_MAGIC:
			case INDEX_ATTACT_HUIBILV:
			case INDEX_ATTACT_JIANMIAN_PHY:
			case INDEX_ATTACT_JIANMIAN_MAGIC:
			case INDEX_ATTACT_JIANMIAN_BAOJI:
			case INDEX_DEFENCE_ADD_YINXING:
			case INDEX_DEFENCE_ADD_BINGXING:
			case INDEX_DEFENCE_ADD_HUANGXING:
			case INDEX_DEFENCE_ADD_SHENXING:
			case INDEX_HUIFU_SWARD_ADD:
			case INDEX_XIAOGUO_FULING:
			case INDEX_HOLE_RED:
			case INDEX_HOLE_YELLOW:
			case INDEX_HOLE_BLUE:
			case INDEX_HOLE_GREEN:
			case INDEX_HUIFU_LIFE:
			case INDEX_HUIFU_SWARD:
			case INDEX_HUIFU_JINGQI:
			case INDEX_HUIFU_DOUQI:
			case INDEX_BANGDING:
			case INDEX_TIME:
			case INDEX_MINGZHONG_2:
			case INDEX_MINGZHONG_LAST:
				return H_PRE;
			default:
				Tools.debugPrintln("UIActorItemDetail:错误key = " + key);
				return 0;
		}
	}

	private void paintName(Graphics g, int x, int y, String att, boolean isFocused, int index)
	{
		g.setColor(COLOR_ATT);
		g.drawString(att, x, y, Tools.LEFT_TOP);
		if (m_names == null) {
			return;
		}
		if (m_color_xiyoudu == null) {
			return;
		}
		int aw = AbstractGameScreen.s_font.stringWidth(att);
		int tempX = (x + aw + IW_STR);
		int sw = AbstractGameScreen.s_font.stringWidth(m_names[index]);
		int tempY = y + 1;
		int w = W_CONTENT - (aw + IW_STR);
		int clipX = g.getClipX();
		int clipY = g.getClipY();
		int clipW = g.getClipWidth();
		int clipH = g.getClipHeight();
		g.setClip(tempX, tempY, w, H_PRE);
		if (sw > w) {
			int relX = UIManager.TIME % sw;
			ActorItem.drawName(g, m_names[index], tempX - relX, y + 1, m_color_xiyoudu[index]);
			ActorItem.drawName(g, m_names[index], tempX + sw - relX, y + 1, m_color_xiyoudu[index]);
		}
		else {
			ActorItem.drawName(g, m_names[index], tempX, y + 1, m_color_xiyoudu[index]);
		}
		g.setClip(clipX, clipY, clipW, clipH);
	}

	private void paintItem(Graphics g, int x, int y, int index, int key)
	{
		int valuesNum = index << 1;
		boolean isFocused = false;// 暂时
		switch (key) {
			case INDEX_NAME:
				paintName(g, x, y, STR_NAME, isFocused, index);
				break;
			case INDEX_BANGDING:
				paintOneAtt(g, x, y,STR_BANGDING, m_bangding[index], isFocused);
				break;
			case INDEX_BANGDING_CISHU:
				if (m_bangdingcishu[index] <= 0) {
					return ;
				}
				paintOneAtt(g, x, y,STR_BANGDINGCISHU, String.valueOf(m_bangdingcishu[index]), isFocused);
				break;
			case INDEX_TIME:
				paintOneAtt(g, x, y, STR_TIME, m_times[index], isFocused);
				break;
			case INDEX_LEVEL:
				paintOneAtt(g, x, y, STR_LEVEL, String.valueOf(m_levels[index]), isFocused);
				break;
			case INDEX_TYPE_SUB:
				paintOneAtt(g, x, y, STR_TYPE_SUB, m_type_subs[index], isFocused);
				break;
			case INDEX_PRICE:
				paintMoney(g, x, y, STR_PRICE, m_prices[index], isFocused, index);
				break;
			case INDEX_NAIJIU:
				paintOneAtt(g, x, y, STR_NAIJIU, String.valueOf(m_naijius[index]) + "/"
						+ String.valueOf(m_naijius_max[index]), isFocused);
				break;
			case INDEX_TYPE_OPER:
				paintDescribe(g, x, y, STR_TYPE_OPER, m_type_opers[index], isFocused);
				break;
			case INDEX_COMMIT_CAREER:
				paintOneAtt(g, x, y, STR_COMMIT_CAREER, m_limit_careers[index], isFocused);
				break;
			case INDEX_COMMIT_LEVEL:
				paintOneAtt(g, x, y, STR_COMMIT_LEVEL, String.valueOf(m_limit_levels[index]), isFocused);
				break;
			case INDEX_COMMIT_EQUIP:
				paintOneAtt(g, x, y, STR_COMMIT_EQUIP, m_limit_equips[index], isFocused);
				break;
			case INDEX_CD:
				paintOneAtt(g, x, y, STR_CD, String.valueOf(m_time_cds[index]), isFocused);
				break;
			case INDEX_DEADLINE:
				paintOneAtt(g, x, y, STR_DEADLINE, String.valueOf(m_time_deadLines[index]), isFocused);
				break;
			case INDEX_ATTACT_PHY:
				paintTwoAtt(g, x, y, STR_ATTACT_PHY, m_attact_phys[valuesNum], m_attact_phys[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_MAGIC_MIN:
				paintTwoAtt(g, x, y, STR_ATTACT_MAGIC_MIN, m_attact_magic_mins[valuesNum],
						m_attact_magic_mins[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_MAGIC_MAX:
				paintTwoAtt(g, x, y, STR_ATTACT_MAGIC_MAX, m_attact_magic_maxs[valuesNum],
						m_attact_magic_maxs[valuesNum + 1], isFocused);
				break;
			case INDEX_DEFENCE_PHY:
				paintTwoAtt(g, x, y, STR_DEFENCE_PHY, m_defence_phys[valuesNum], m_defence_phys[valuesNum + 1],
						isFocused);
				break;
			case INDEX_MINGZHONG_2:
				paintTwoAtt(g, x, y, STR_MINGZHONG_2, m_mingzhong_2[valuesNum], m_mingzhong_2[valuesNum + 1], isFocused);
				break;
			case INDEX_MINGZHONG_LAST:
				paintTwoAtt(g, x, y, STR_MINGZHONG_LAST, m_mingzhong_last[valuesNum], m_mingzhong_last[valuesNum + 1],
						isFocused);
				break;
			case INDEX_DEFENCE_MAGIC:
				paintTwoAtt(g, x, y, STR_DEFENCE_MAGIC, m_defence_magics[valuesNum], m_defence_magics[valuesNum + 1],
						isFocused);
				break;
			case INDEX_HIT_BASIC:
				paintTwoAtt(g, x, y, STR_HIT_BASIC, m_hit_basics[valuesNum], m_hit_basics[valuesNum + 1], isFocused);
				break;
			case INDEX_MAXHP:
				paintTwoAtt(g, x, y, STR_MAXHP, m_maxhps[valuesNum], m_maxhps[valuesNum + 1], isFocused);
				break;
			case INDEX_MAXMP:
				paintTwoAtt(g, x, y, STR_MAXMP, m_maxmps[valuesNum], m_maxmps[valuesNum + 1], isFocused);
				break;
			case INDEX_SPEED_HP:
				paintTwoAtt(g, x, y, STR_SPEED_HP, m_speed_hps[valuesNum], m_speed_hps[valuesNum + 1], isFocused);
				break;
			case INDEX_SPEED_MP:
				paintTwoAtt(g, x, y, STR_SPEED_MP, m_speed_mps[valuesNum], m_speed_mps[valuesNum + 1], isFocused);
				break;
			case INDEX_FORCE:
				paintTwoAtt(g, x, y, STR_FORCE, m_foces[valuesNum], m_foces[valuesNum + 1], isFocused);
				break;
			case INDEX_INTELLIGENCE:
				paintTwoAtt(g, x, y, STR_INTELLIGENCE, m_intelligences[valuesNum], m_intelligences[valuesNum + 1],
						isFocused);
				break;
			case INDEX_JIQIAO:
				paintTwoAtt(g, x, y, STR_JIQIAO, m_jiqiaos[valuesNum], m_jiqiaos[valuesNum + 1], isFocused);
				break;
			case INDEX_MINJIE:
				paintTwoAtt(g, x, y, STR_MINJIE, m_minjies[valuesNum], m_minjies[valuesNum + 1], isFocused);
				break;
			case INDEX_NAILI:
				paintTwoAtt(g, x, y, STR_NAILI, m_nailis[valuesNum], m_nailis[valuesNum + 1], isFocused);
				break;
			case INDEX_LUCK:
				paintTwoAtt(g, x, y, STR_LUCK, m_lucks[valuesNum], m_lucks[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_MAGIC_ADD:
				paintTwoAtt(g, x, y, STR_ATTACT_MAGIC_ADD, m_attact_magic_adds[valuesNum],
						m_attact_magic_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_YINXING_ADD:
				paintTwoAtt(g, x, y, STR_ATTACT_YINXING_ADD, m_attact_yinxing_adds[valuesNum],
						m_attact_yinxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_BINGXING_ADD:
				paintTwoAtt(g, x, y, STR_ATTACT_BINGXING_ADD, m_attact_bingxing_adds[valuesNum],
						m_attact_yinxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_HUANGXING_ADD:
				paintTwoAtt(g, x, y, STR_ATTACT_HUANGXING_ADD, m_attact_huangxing_adds[valuesNum],
						m_attact_huangxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_SHENXING_ADD:
				paintTwoAtt(g, x, y, STR_ATTACT_SHENXING_ADD, m_attact_shenxing_adds[valuesNum],
						m_attact_shenxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_BAOJI_PHY:
				paintTwoAtt(g, x, y, STR_ATTACT_BAOJI_PHY, m_attact_baoji_phy[valuesNum],
						m_attact_baoji_phy[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_BAOJI_MAGIC:
				paintTwoAtt(g, x, y, STR_ATTACT_BAOJI_MAGIC, m_attact_baoji_magic[valuesNum],
						m_attact_baoji_magic[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_BAOJI_PHY_ADD:
				paintTwoAtt(g, x, y, STR_ATTACT_BAOJI_PHY_ADD, m_attact_baoji_phy_adds[valuesNum],
						m_attact_baoji_phy_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_BAOJI_MAGIC_ADD:
				paintTwoAtt(g, x, y, STR_ATTACT_BAOJI_MAGIC_ADD, m_attact_baoji_magic_adds[valuesNum],
						m_attact_baoji_magic_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_CHUANTOU_PHY:
				paintTwoAtt(g, x, y, STR_ATTACT_CHUANTOU_PHY, m_attact_chuantou_phys[valuesNum],
						m_attact_chuantou_phys[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_CHUANTOU_MAGIC:
				paintTwoAtt(g, x, y, STR_ATTACT_CHUANTOU_MAGIC, m_attact_chuantou_magics[valuesNum],
						m_attact_chuantou_magics[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_FINAL_PHY:
				paintTwoAtt(g, x, y, STR_ATTACT_FINAL_PHY, m_attact_final_phys[valuesNum],
						m_attact_final_phys[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_FINAL_MAGIC:
				paintTwoAtt(g, x, y, STR_ATTACT_FINAL_MAGIC, m_attact_final_magics[valuesNum],
						m_attact_final_magics[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_HUIBILV:
				paintTwoAtt(g, x, y, STR_ATTACT_HUIBILV, m_attact_huibilvs[valuesNum],
						m_attact_huibilvs[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_JIANMIAN_PHY:
				paintTwoAtt(g, x, y, STR_ATTACT_JIANMIAN_PHY, m_attact_jianmian_phys[valuesNum],
						m_attact_jianmian_phys[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_JIANMIAN_MAGIC:
				paintTwoAtt(g, x, y, STR_ATTACT_JIANMIAN_MAGIC, m_attact_jianmian_magics[valuesNum],
						m_attact_jianmian_magics[valuesNum + 1], isFocused);
				break;
			case INDEX_ATTACT_JIANMIAN_BAOJI:
				paintTwoAtt(g, x, y, STR_ATTACT_JIANMIAN_BAOJI, m_attact_jianmian_baojis[valuesNum],
						m_attact_jianmian_baojis[valuesNum + 1], isFocused);
				break;
			case INDEX_DEFENCE_ADD_YINXING:
				paintTwoAtt(g, x, y, STR_DEFENCE_ADD_YINXING, m_dence_yinxing_adds[valuesNum],
						m_dence_yinxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_DEFENCE_ADD_BINGXING:
				paintTwoAtt(g, x, y, STR_DEFENCE_ADD_BINGXING, m_dence_bingxing_adds[valuesNum],
						m_dence_bingxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_DEFENCE_ADD_HUANGXING:
				paintTwoAtt(g, x, y, STR_DEFENCE_ADD_HUANGXING, m_dence_huangxing_adds[valuesNum],
						m_dence_huangxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_DEFENCE_ADD_SHENXING:
				paintTwoAtt(g, x, y, STR_DEFENCE_ADD_SHENXING, m_dence_shengxing_adds[valuesNum],
						m_dence_shengxing_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_HUIFU_SWARD_ADD:
				paintTwoAtt(g, x, y, STR_HUIFU_SWARD_ADD, m_huifu_sward_adds[valuesNum],
						m_huifu_sward_adds[valuesNum + 1], isFocused);
				break;
			case INDEX_XIAOGUO_FULING:
				paintTwoAtt(g, x, y, STR_XIAOGUO_FULING, m_result_fulings[valuesNum], m_result_fulings[valuesNum + 1],
						isFocused);
				break;
			case INDEX_HOLE_RED:
				paintTwoAtt(g, x, y, STR_HOLE_RED, m_hole_reds[valuesNum], m_hole_reds[valuesNum + 1], isFocused);
				break;
			case INDEX_HOLE_YELLOW:
				paintTwoAtt(g, x, y, STR_HOLE_YELLOW, m_hole_yellows[valuesNum], m_hole_yellows[valuesNum + 1],
						isFocused);
				break;
			case INDEX_HOLE_BLUE:
				paintTwoAtt(g, x, y, STR_HOLE_BLUE, m_hole_blues[valuesNum], m_hole_blues[valuesNum + 1], isFocused);
				break;
			case INDEX_HOLE_GREEN:
				paintTwoAtt(g, x, y, STR_HOLE_GREEN, m_hole_greens[valuesNum], m_hole_greens[valuesNum + 1], isFocused);
				break;
			case INDEX_HUIFU_LIFE:
				paintTwoAtt(g, x, y, STR_HUIFU_LIFE, m_huifu_lifes[valuesNum], m_huifu_lifes[valuesNum + 1], isFocused);
				break;
			case INDEX_HUIFU_SWARD:
				paintTwoAtt(g, x, y, STR_HUIFU_SWARD, m_huifu_swards[valuesNum], m_huifu_swards[valuesNum + 1],
						isFocused);
				break;
			case INDEX_HUIFU_JINGQI:
				paintTwoAtt(g, x, y, STR_HUIFU_JINGQI, m_huifu_jingqis[valuesNum], m_huifu_jingqis[valuesNum + 1],
						isFocused);
				break;
			case INDEX_HUIFU_DOUQI:
				paintTwoAtt(g, x, y, STR_HUIFU_DOUQI, m_huifu_douqis[valuesNum], m_huifu_douqis[valuesNum + 1],
						isFocused);
				break;
			case INDEX_DESCRBE:
				paintDescribe(g, x, y, STR_DESCRBE, m_describes[index], isFocused);
				break;
			case INDEX_TAOZHUANG:
				paintOneAtt(g, x, y, STR_TAOZHUANG, "套装", isFocused);
				break;
			case INDEX_DESCRIBE_DEF:
				paintDescribe(g, x, y, STR_DESCRIBE_DEF, m_describe_defs[index], isFocused);
				break;
			case INDEX_JEWEL:
				paintOneAtt(g, x, y, STR_JEWEL, "宝石", isFocused);
				break;
			case INDEX_TAOZHUANG_INFO:
				paintTaozhuang(g, x, y, index, isFocused);
				break;
			case INDEX_LEVEL_WEAPON_WULI:
				if (m_level_weapon_wulin[index] <= 0) {
					return ;
				}
				paintOneAtt(g, x, y, STR_LEVEL_WEAPON_WULI, String.valueOf(m_level_weapon_wulin[index]), isFocused);
				break;
			case INDEX_LEVEL_WEAPON_FASHU:
				if (m_level_weapon_fashu[index] <= 0) {
					return ;
				}
				paintOneAtt(g, x, y, STR_LEVEL_WEAPON_FASHU, String.valueOf(m_level_weapon_fashu[index]), isFocused);
				break;
			default:
				Tools.debugPrintln("服务器数据出错 Key = " + key);
				break;
		}
	}

	/**
	 * 2012-2-22 下午02:44:07 venizeng
	 * 
	 * @param g
	 * @param x
	 * @param y
	 * @param att
	 * @param l
	 * @param isFocused
	 * @return
	 */
	private void paintMoney(Graphics g, int x, int y, String att, long l, boolean isFocused, int index)
	{
		g.setColor(COLOR_ATT);
		g.drawString(att, x, y, Tools.LEFT_TOP);
		int w = AbstractGameScreen.s_font.stringWidth(att);
		UITools.paintMoneyGameLB(g, x + w + 1, y + AbstractGameScreen.FONT_H, l, false);
	}

	/**
	 * 当前行描述只具有一个值
	 * 
	 * @param g
	 * @param y
	 * @param x
	 * @param att
	 * @param content
	 * @param isSel
	 * @return
	 */
	private void paintOneAtt(Graphics g, int x, int y, String att, String content, boolean isSel)
	{
		g.setColor(COLOR_ATT);
		g.drawString(att, x, y, Tools.LEFT_TOP);
		int tempX = (x + AbstractGameScreen.s_font.stringWidth(att) + IW_STR);
		g.setColor(COLOR_A);
		g.drawString(content, tempX, y + 1, Tools.LEFT_TOP);
	}

	/**
	 * 数据具有两个值 A + B 2012-2-22 下午06:19:11 venizeng
	 * 
	 * @param g
	 * @param x
	 * @param y
	 * @param att
	 * @param attA
	 * @param attB
	 * @param isSel
	 * @return
	 */
	private void paintTwoAtt(Graphics g, int x, int y, String att, int attA, int attB, boolean isSel)
	{
		int tempX = x;
		// 绘制属性
		g.setColor(COLOR_ATT);
		g.drawString(att, tempX, y, 0);
		// 绘制属性A
		tempX += (AbstractGameScreen.s_font.stringWidth(att) + IW_STR);
		String valueA = String.valueOf(attA);
		g.setColor(COLOR_A);
		g.drawString(valueA, tempX, y, 0);
		if (attB == 0) {
			return;
		}
		// 绘制+
		tempX += (AbstractGameScreen.s_font.stringWidth(valueA) + IW_STR);
		g.setColor(COLOR_PLUS);
		g.drawString(PLUS, tempX, y, 0);
		// 绘制属性B
		tempX += (IW_PLUS + IW_STR);
		String valueB = String.valueOf(attB);
		g.setColor(COLOR_B);
		g.drawString(valueB, tempX, y, 0);
	}

	/**
	 * 此处暂时不做处理，用于绘制多行文字的情况
	 * 
	 * @param g
	 * @param x
	 * @param y
	 * @param att
	 * @param describe
	 * @param isSel
	 * @return
	 */
	private void paintDescribe(Graphics g, int x, int y, String att, String[] describes, boolean isSel)
	{
		if (describes == null) {
			return;
		}
		int tempY = y;
		g.setColor(COLOR_DESCRIBE);
		for (int i = 0, length = describes.length; i < length; i++) {
			if (describes[i] == null) {
				continue;
			}
			g.drawString(describes[i], x, tempY, 0);
			tempY += H_PRE;
		}
	}

	/**
	 * 绘制套装 套装名字一行 套装部件名字一行 ，是否穿上和套装部件名字同一行 ，如果穿上则绿色，否则黄色，需要件数在同一行 套装部件描述行数不定
	 * 2012-2-22 下午07:07:29 venizeng
	 * 
	 * @param g
	 * @param x
	 * @param y
	 * @param name_taozhuang
	 * @param name_taozhuang_part
	 * @param isOn
	 * @param atts
	 * @param num_parts
	 * @param isWorking
	 * @param isSel
	 * @return
	 */
	private void paintTaozhuang(Graphics g, int x, int y, int index, boolean isSel)
	{
		int tempY = y;
		g.setColor(COLOR_TAOZHUANG_NAME);
		g.drawString(STR_TAOZHUANG_INFO, x, tempY, 0);
		g.drawString(m_taozhuang_name[index], x + 70, tempY, 0);
		tempY = y + H_PRE;
		if (m_taozhuang_part_name == null) {
			return;
		}
		for (int i = 0, length = m_taozhuang_part_name.length; i < length; i++) {
			if (m_taozhuang_part_isOn[index][i]) {
				g.setColor(COLOR_TAOZHUANG_SHARE_ON);
			}
			else {
				g.setColor(COLOR_TAOZHUANG_SHARE_OFF);
			}
			g.drawString(m_taozhuang_part_name[index][i], x + 10, tempY, 0);
			tempY += H_PRE;
		}
		if (m_taozhuang_part_att == null) {
			return;
		}
		for (int i = 0, length = m_taozhuang_part_att.length; i < length; i++) {
			if (m_taozhuang_part_isWorking[index][i]) {
				g.setColor(COLOR_TAOZHUANG_SHARE_WROKING);
			}
			else {
				g.setColor(COLOR_TAOZHUANG_SHARE_UNWROKING);
			}
			g.drawString("需要件数  ", x, tempY, 0);
			tempY += H_PRE;
			//
			int tempX = x + 10;
			String[] temps = m_taozhuang_part_att[index][i];
			if (temps == null) {
				continue;
			}
			for (int j = 0; j < temps.length; j++) {
				if (temps[j] == null) {
					continue;
				}
				g.drawString(temps[i], tempX, tempY, 0);
				tempY += H_PRE;
			}
		}
	}

	public static final void recvMessage(int orderId, DataInputStream dis) throws IOException
	{
		Tools.debugPrintln("获得道具详情");
		UIActorItemDetail detail = (UIActorItemDetail) UIManager.getInstance().getWindowById(
				UIWindowFactory.WINDOW_ACTOR_DETAIL);
		if (detail != null) {// 重复请求了
			return;
		}
		short state = dis.readShort();
		String info = dis.readUTF();
		if (state == 0) {
			if (!info.equals("")) {
				GameManager.getInstance().addSystemInfo(GameManager.SYSTEM_INFO_TYPE_B, info);
			}
			return;
		}
		int num = dis.readInt();
		if (num <= 0) {
			GameManager.getInstance().addSystemInfo(GameManager.SYSTEM_INFO_TYPE_B, "数据错误");
			return;
		}
		detail = (UIActorItemDetail) UIWindowFactory.createWindow(UIWindowFactory.WINDOW_ACTOR_DETAIL);
		detail.m_keys = new short[num][];
		short[] temps = null;
		for (int i = 0; i < num; i++) {
			int num_describe = dis.readInt();
			if (num_describe <= 0) {
				temps = null;
			}
			else {
				temps = new short[num_describe];
				for (int j = 0; j < temps.length; j++) {
					temps[j] = (short) detail.NUMBER_USELESS;
				}
				for (int j = 0; j < num_describe; j++) {
					detail.recvDetail(i, temps, j, num, dis);
				}
				// 实际有效
				int tempNum = 0;
				for (int j = 0; j < temps.length; j++) {
					if (temps[j] == detail.NUMBER_USELESS) {
						continue;
					}
					tempNum++;
				}
				if (tempNum == 0) {
					detail.m_keys[i] = null;
				}
				else {
					detail.m_keys[i] = new short[tempNum];
					int index = 0;
					for (int j = 0; j < temps.length; j++) {
						if (temps[j] == detail.NUMBER_USELESS) {
							continue;
						}
						detail.m_keys[i][index] = temps[j];
						index++;
					}
				}
			}
		}
		detail.init();
		UIManager.getInstance().addWindow(detail);
	}

	private final void recvDetail(int index, short[] temps, int where, int num, DataInputStream dis) throws IOException
	{
		short key = dis.readShort();
		switch (key) {
			case INDEX_NAME:
				if (m_names == null) {
					m_names = new String[num];
					m_color_xiyoudu = new byte[num];
				}
				m_names[index] = dis.readUTF();
				m_color_xiyoudu[index] = dis.readByte();
				break;
			case INDEX_LEVEL:
				if (m_levels == null) {
					m_levels = new int[num];
				}
				int level = dis.readInt();
				if (level == 0) {
					key = NUMBER_USELESS;
				}
				else {
					m_levels[index] = level;
				}
				break;
			case INDEX_TYPE_SUB:
				if (m_type_subs == null) {
					m_type_subs = new String[num];
				}
				m_type_subs[index] = dis.readUTF();
				break;
			case INDEX_BANGDING:
				if (m_bangding == null) {
					m_bangding = new String[num];
				}
				String temp = "";
				switch (dis.readByte()) {
					case -1:
						temp = "已绑定";
						break;
					case 0:
						temp = "不绑定";
						break;
					case 1:
						temp = "装备后绑定";
						break;
					case 2:
						temp = "拾取后绑定";
						break;
					case 3:
						temp = "使用后绑定";
						break;
				}
				m_bangding[index] = temp;
				break;
			case INDEX_TIME:
				if (m_times == null) {
					m_times = new String[num];
				}
				long time = dis.readLong();
				if (time == 0) {
					key = NUMBER_USELESS;
					return;
				}
				m_times[index] = UIAttribute.changeTime(time);
				break;
			case INDEX_PRICE:
				if (m_prices == null) {
					m_prices = new long[num];
				}
				long money = dis.readLong();
				if (money == 0) {
					key = NUMBER_USELESS;
				}
				m_prices[index] = money;
				break;
			case INDEX_NAIJIU:
				if (m_naijius == null) {
					m_naijius = new short[num];
				}
				if (m_naijius_max == null) {
					m_naijius_max = new short[num];
				}
				short naijiu = dis.readShort();
				short maxNaijiu = dis.readShort();
				if (maxNaijiu == 0) {
					key = NUMBER_USELESS;
				}
				else {
					m_naijius[index] = naijiu;
					m_naijius_max[index] = maxNaijiu;
				}
				break;
			case INDEX_TYPE_OPER: {
				if (m_type_opers == null) {
					m_type_opers = new String[num][];
				}
				if (m_type_operB == null) {
					m_type_operB = new int[num];
				}
				int operType = dis.readInt();
				boolean isDrop = Tools.getBitNum(operType, 0);// 可丢弃
				boolean isDealWithNpc = Tools.getBitNum(operType, 1);// 可出售
				boolean isDealWithPlayer = Tools.getBitNum(operType, 2);// 可交易
				boolean isQIanghua = Tools.getBitNum(operType, 3);// 可强化
				boolean isResolve = Tools.getBitNum(operType, 4);// 可分解
				boolean isUseAtAnyTime = Tools.getBitNum(operType, 5);// 是否可以在任意时使用
				boolean isUseAtFight = Tools.getBitNum(operType, 6);// 是否只能在战斗中使用
				m_type_operB[index] = operType;
				m_type_opers[index] = new String[7];
				m_type_opers[index][0] = isDrop ? "可丢弃" : "";
				m_type_opers[index][1] = isDealWithNpc ? "可出售" : null;
				m_type_opers[index][2] = isDealWithPlayer ? "可交易" : null;
				m_type_opers[index][3] = isQIanghua ? "可强化" : null;
				m_type_opers[index][4] = isResolve ? "可分解" : null;
				m_type_opers[index][5] = isUseAtAnyTime ? "可任意时间使用" : null;
				m_type_opers[index][6] = isUseAtFight ? "只能在战斗中使用" : null;
			}
				break;
			case INDEX_COMMIT_CAREER:
				if (m_limit_careers == null) {
					m_limit_careers = new String[num];
				}
				m_limit_careers[index] = dis.readUTF();
				break;
			case INDEX_COMMIT_LEVEL:
				if (m_limit_levels == null) {
					m_limit_levels = new int[num];
				}
				int level_limit = dis.readInt();
				if (level_limit == 0) {
					key = NUMBER_USELESS;
				}
				else {
					m_limit_levels[index] = level_limit;
				}
				break;
			case INDEX_COMMIT_EQUIP:
				if (m_limit_equips == null) {
					m_limit_equips = new String[num];
				}
				m_limit_equips[index] = dis.readUTF();
				break;
			case INDEX_CD:
				if (m_time_cds == null) {
					m_time_cds = new int[num];
				}
				int cdTime = dis.readInt();
				if (cdTime == 0) {
					key = NUMBER_USELESS;
				}
				else {
					m_time_cds[index] = cdTime;
				}
				break;
			case INDEX_DEADLINE:
				if (m_time_deadLines == null) {
					m_time_deadLines = new long[num];
				}
				long delineTime = dis.readLong();
				if (delineTime == 0) {
					key = NUMBER_USELESS;
				}
				else {
					m_time_deadLines[index] = delineTime;
				}
				break;
			case INDEX_ATTACT_PHY:
				if (m_attact_phys == null) {
					m_attact_phys = new int[num << 1];
				}
				m_attact_phys[index << 1] = dis.readInt();
				m_attact_phys[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_MAGIC_MIN:
				if (m_attact_magic_mins == null) {
					m_attact_magic_mins = new int[num << 1];
				}
				m_attact_magic_mins[index << 1] = dis.readInt();
				m_attact_magic_mins[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_MAGIC_MAX:
				if (m_attact_magic_maxs == null) {
					m_attact_magic_maxs = new int[num << 1];
				}
				m_attact_magic_maxs[index << 1] = dis.readInt();
				m_attact_magic_maxs[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_DEFENCE_PHY:
				if (m_defence_phys == null) {
					m_defence_phys = new int[num << 1];
				}
				m_defence_phys[index << 1] = dis.readInt();
				m_defence_phys[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_DEFENCE_MAGIC:
				if (m_defence_magics == null) {
					m_defence_magics = new int[num << 1];
				}
				m_defence_magics[index << 1] = dis.readInt();
				m_defence_magics[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HIT_BASIC:
				if (m_hit_basics == null) {
					m_hit_basics = new int[num << 1];
				}
				m_hit_basics[index << 1] = dis.readInt();
				m_hit_basics[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_MAXHP:
				if (m_maxhps == null) {
					m_maxhps = new int[num << 1];
				}
				m_maxhps[index << 1] = dis.readInt();
				m_maxhps[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_MAXMP:
				if (m_maxmps == null) {
					m_maxmps = new int[num << 1];
				}
				m_maxmps[index << 1] = dis.readInt();
				m_maxmps[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_SPEED_HP:
				if (m_speed_hps == null) {
					m_speed_hps = new int[num << 1];
				}
				m_speed_hps[index << 1] = dis.readInt();
				m_speed_hps[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_SPEED_MP:
				if (m_speed_mps == null) {
					m_speed_mps = new int[num << 1];
				}
				m_speed_mps[index << 1] = dis.readInt();
				m_speed_mps[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_FORCE:
				if (m_foces == null) {
					m_foces = new int[num << 1];
				}
				m_foces[index << 1] = dis.readInt();
				m_foces[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_INTELLIGENCE:
				if (m_intelligences == null) {
					m_intelligences = new int[num << 1];
				}
				m_intelligences[index << 1] = dis.readInt();
				m_intelligences[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_JIQIAO:
				if (m_jiqiaos == null) {
					m_jiqiaos = new int[num << 1];
				}
				m_jiqiaos[index << 1] = dis.readInt();
				m_jiqiaos[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_MINJIE:
				if (m_minjies == null) {
					m_minjies = new int[num << 1];
				}
				m_minjies[index << 1] = dis.readInt();
				m_minjies[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_NAILI:
				if (m_nailis == null) {
					m_nailis = new int[num << 1];
				}
				m_nailis[index << 1] = dis.readInt();
				m_nailis[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_LUCK:
				if (m_lucks == null) {
					m_lucks = new int[num << 1];
				}
				m_lucks[index << 1] = dis.readInt();
				m_lucks[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_MAGIC_ADD:
				if (m_attact_magic_adds == null) {
					m_attact_magic_adds = new int[num << 1];
				}
				m_attact_magic_adds[index << 1] = dis.readInt();
				m_attact_magic_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_YINXING_ADD:
				if (m_attact_yinxing_adds == null) {
					m_attact_yinxing_adds = new int[num << 1];
				}
				m_attact_yinxing_adds[index << 1] = dis.readInt();
				m_attact_yinxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_BINGXING_ADD:
				if (m_attact_bingxing_adds == null) {
					m_attact_bingxing_adds = new int[num << 1];
				}
				m_attact_bingxing_adds[index << 1] = dis.readInt();
				m_attact_bingxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_HUANGXING_ADD:
				if (m_attact_huangxing_adds == null) {
					m_attact_huangxing_adds = new int[num << 1];
				}
				m_attact_huangxing_adds[index << 1] = dis.readInt();
				m_attact_huangxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_SHENXING_ADD:
				if (m_attact_shenxing_adds == null) {
					m_attact_shenxing_adds = new int[num << 1];
				}
				m_attact_shenxing_adds[index << 1] = dis.readInt();
				m_attact_shenxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_BAOJI_PHY:
				if (m_attact_baoji_phy == null) {
					m_attact_baoji_phy = new int[num << 1];
				}
				m_attact_baoji_phy[index << 1] = dis.readInt();
				m_attact_baoji_phy[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_BAOJI_MAGIC:
				if (m_attact_baoji_magic == null) {
					m_attact_baoji_magic = new int[num << 1];
				}
				m_attact_baoji_magic[index << 1] = dis.readInt();
				m_attact_baoji_magic[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_BAOJI_PHY_ADD:
				if (m_attact_baoji_phy_adds == null) {
					m_attact_baoji_phy_adds = new int[num << 1];
				}
				m_attact_baoji_phy_adds[index << 1] = dis.readInt();
				m_attact_baoji_phy_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_BAOJI_MAGIC_ADD:
				if (m_attact_baoji_magic_adds == null) {
					m_attact_baoji_magic_adds = new int[num << 1];
				}
				m_attact_baoji_magic_adds[index << 1] = dis.readInt();
				m_attact_baoji_magic_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_CHUANTOU_PHY:
				if (m_attact_chuantou_phys == null) {
					m_attact_chuantou_phys = new int[num << 1];
				}
				m_attact_chuantou_phys[index << 1] = dis.readInt();
				m_attact_chuantou_phys[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_CHUANTOU_MAGIC:
				if (m_attact_chuantou_magics == null) {
					m_attact_chuantou_magics = new int[num << 1];
				}
				m_attact_chuantou_magics[index << 1] = dis.readInt();
				m_attact_chuantou_magics[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_FINAL_PHY:
				if (m_attact_final_phys == null) {
					m_attact_final_phys = new int[num << 1];
				}
				m_attact_final_phys[index << 1] = dis.readInt();
				m_attact_final_phys[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_FINAL_MAGIC:
				if (m_attact_final_magics == null) {
					m_attact_final_magics = new int[num << 1];
				}
				m_attact_final_magics[index << 1] = dis.readInt();
				m_attact_final_magics[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_HUIBILV:
				if (m_attact_huibilvs == null) {
					m_attact_huibilvs = new int[num << 1];
				}
				m_attact_huibilvs[index << 1] = dis.readInt();
				m_attact_huibilvs[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_JIANMIAN_PHY:
				if (m_attact_jianmian_phys == null) {
					m_attact_jianmian_phys = new int[num << 1];
				}
				m_attact_jianmian_phys[index << 1] = dis.readInt();
				m_attact_jianmian_phys[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_JIANMIAN_MAGIC:
				if (m_attact_jianmian_magics == null) {
					m_attact_jianmian_magics = new int[num << 1];
				}
				m_attact_jianmian_magics[index << 1] = dis.readInt();
				m_attact_jianmian_magics[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_ATTACT_JIANMIAN_BAOJI:
				if (m_attact_jianmian_baojis == null) {
					m_attact_jianmian_baojis = new int[num << 1];
				}
				m_attact_jianmian_baojis[index << 1] = dis.readInt();
				m_attact_jianmian_baojis[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_DEFENCE_ADD_YINXING:
				if (m_dence_yinxing_adds == null) {
					m_dence_yinxing_adds = new int[num << 1];
				}
				m_dence_yinxing_adds[index << 1] = dis.readInt();
				m_dence_yinxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_DEFENCE_ADD_BINGXING:
				if (m_dence_bingxing_adds == null) {
					m_dence_bingxing_adds = new int[num << 1];
				}
				m_dence_bingxing_adds[index << 1] = dis.readInt();
				m_dence_bingxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_DEFENCE_ADD_HUANGXING:
				if (m_dence_huangxing_adds == null) {
					m_dence_huangxing_adds = new int[num << 1];
				}
				m_dence_huangxing_adds[index << 1] = dis.readInt();
				m_dence_huangxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_DEFENCE_ADD_SHENXING:
				if (m_dence_shengxing_adds == null) {
					m_dence_shengxing_adds = new int[num << 1];
				}
				m_dence_shengxing_adds[index << 1] = dis.readInt();
				m_dence_shengxing_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HUIFU_SWARD_ADD:
				if (m_huifu_sward_adds == null) {
					m_huifu_sward_adds = new int[num << 1];
				}
				m_huifu_sward_adds[index << 1] = dis.readInt();
				m_huifu_sward_adds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_XIAOGUO_FULING:
				if (m_result_fulings == null) {
					m_result_fulings = new int[num << 1];
				}
				m_result_fulings[index << 1] = dis.readInt();
				m_result_fulings[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HOLE_RED:
				if (m_hole_reds == null) {
					m_hole_reds = new int[num << 1];
				}
				m_hole_reds[index << 1] = dis.readInt();
				m_hole_reds[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HOLE_YELLOW:
				if (m_hole_yellows == null) {
					m_hole_yellows = new int[num << 1];
				}
				m_hole_yellows[index << 1] = dis.readInt();
				m_hole_yellows[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HOLE_BLUE:
				if (m_hole_blues == null) {
					m_hole_blues = new int[num << 1];
				}
				m_hole_blues[index << 1] = dis.readInt();
				m_hole_blues[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HOLE_GREEN:
				if (m_hole_greens == null) {
					m_hole_greens = new int[num << 1];
				}
				m_hole_greens[index << 1] = dis.readInt();
				m_hole_greens[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HUIFU_LIFE:
				if (m_huifu_lifes == null) {
					m_huifu_lifes = new int[num << 1];
				}
				m_huifu_lifes[index << 1] = dis.readInt();
				m_huifu_lifes[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HUIFU_SWARD:
				if (m_huifu_swards == null) {
					m_huifu_swards = new int[num << 1];
				}
				m_huifu_swards[index << 1] = dis.readInt();
				m_huifu_swards[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HUIFU_JINGQI:
				if (m_huifu_jingqis == null) {
					m_huifu_jingqis = new int[num << 1];
				}
				m_huifu_jingqis[index << 1] = dis.readInt();
				m_huifu_jingqis[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_HUIFU_DOUQI:
				if (m_huifu_douqis == null) {
					m_huifu_douqis = new int[num << 1];
				}
				m_huifu_douqis[index << 1] = dis.readInt();
				m_huifu_douqis[(index << 1) + 1] = dis.readInt();
				break;

			case INDEX_MINGZHONG_2:
				if (m_mingzhong_2 == null) {
					m_mingzhong_2 = new int[num << 1];
				}
				m_mingzhong_2[index << 1] = dis.readInt();
				m_mingzhong_2[(index << 1) + 1] = dis.readInt();
				break;
			case INDEX_MINGZHONG_LAST:
				if (m_mingzhong_last == null) {
					m_mingzhong_last = new int[num << 1];
				}
				m_mingzhong_last[index << 1] = dis.readInt();
				m_mingzhong_last[(index << 1) + 1] = dis.readInt();
				break;

			case INDEX_LEVEL_WEAPON_WULI:
				if (m_level_weapon_wulin == null) {
					m_level_weapon_wulin = new int[num];
				}
				m_level_weapon_wulin[index] = dis.readInt();
				break;
			case INDEX_LEVEL_WEAPON_FASHU:
				if (m_level_weapon_fashu == null) {
					m_level_weapon_fashu = new int[num];
				}
				m_level_weapon_fashu[index] = dis.readInt();
				break;
			case INDEX_DESCRBE:
				if (m_describes == null) {
					m_describes = new String[num][];
				}
				m_describes[index] = Tools.getStrArray(dis.readUTF(), W_CONTENT);
				break;
			case INDEX_TAOZHUANG:
				if (m_taozhuangs == null) {
					m_taozhuangs = new int[num];
				}
				m_taozhuangs[index] = dis.readInt();
				break;
			case INDEX_DESCRIBE_DEF:
				if (m_describe_defs == null) {
					m_describe_defs = new String[num][];
				}
				m_describe_defs[index] = Tools.getStrArray(dis.readUTF(), W_CONTENT);
				break;
			case INDEX_TAOZHUANG_INFO:
				if (m_taozhuang_name == null) {
					m_taozhuang_name = new String[num];
				}
				m_taozhuang_name[index] = dis.readUTF();
				byte num_part = dis.readByte();//
				if (num_part > 0) {
					if (m_taozhuang_part_name == null) {
						m_taozhuang_part_name = new String[num][num_part];
					}
					if (m_taozhuang_part_isOn == null) {
						m_taozhuang_part_isOn = new boolean[num][num_part];
					}
					for (byte i = 0; i < num_part; i++) {
						m_taozhuang_part_name[index][i] = dis.readUTF();
						m_taozhuang_part_isOn[index][i] = dis.readByte() == 0 ? false : true;
					}
				}
				int num_part_describe = dis.readByte();
				if (num_part_describe > 0) {
					if (m_taozhuang_part_att == null) {
						m_taozhuang_part_att = new String[num][num_part_describe][];
					}
					if (m_taozhuang_part_numNeed == null) {
						m_taozhuang_part_numNeed = new byte[num][num_part_describe];
					}
					if (m_taozhuang_part_isWorking == null) {
						m_taozhuang_part_isWorking = new boolean[num][num_part_describe];
					}
					for (int j = 0; j < num_part_describe; j++) {
						m_taozhuang_part_att[index][j] = Tools.getStrArray(dis.readUTF(), AbstractGameScreen.s_font,
								m_w);
						m_taozhuang_part_numNeed[index][j] = dis.readByte();
						m_taozhuang_part_isWorking[index][j] = dis.readByte() == 0 ? false : true;
					}
				}
				break;
			case INDEX_JEWEL:
				break;
			case INDEX_BANGDING_CISHU:
				if (m_bangdingcishu == null) {
					m_bangdingcishu = new int[num];
				}
				m_bangdingcishu[index] = dis.readInt();
				break;
			default:
				Tools.debugPrintln("服务器数据出错 Key = " + key);
				break;
		}
		temps[where] = key;
	}

	protected void registerTouch() {
		clearAllRects();
		registerNormalSoft();
		
		int[][]rect = new int[][]{
				{446,39,20,31},
				{446,240,20,31},
		};
		initTouchRect(rect);
	}

	protected void onTouchRect(int[][] rect, int touchid) {
		switch(touchid) {
		case 0:
			GameTouchManager.keyPressedDir(1);
			break;
		case 1:
			GameTouchManager.keyPressedDir(3);
			break;
		}
	}
	
	
	
	
}
